﻿package com.translation.android.tools;

import java.util.HashMap;

public class ConvertHtml2Symbols {
	private static final String[] html = {"&#658;","&#601;","&#230;","&#716;","&#596;", "&#652;","&#643;","&#952;","&#240;","&#331","&#593;"};
	private static final String[] symbols = {"ʒ", "ə","æ","ˌ","ɔ","Λ","∫","ϑ","ð","ŋ","ɑ"};
//	private static final HashMap<String, String> convert = new HashMap<String, String>();
	
	
	//html编码转换
	public static String convert(String pronounce){
		String convertString = pronounce;
		//如果含有"&#"标记
		if(pronounce.contains("&#")){
			for(int i = 0 ; i < html.length ; i++){
				if(pronounce.contains(html[i])){
					convertString = pronounce.replaceAll(html[i], symbols[i]);
					pronounce = convertString;
				}
			}
		}
		return convertString;
	}
}